﻿using NUnit.Framework;

namespace SvnDeploy.Service.Cfg
{
    public class SvnDeploymentConfigurationSectionTests
    {
        private SvnDeployConfigurationSection config;

        [SetUp]
        public void BeforeEachTest()
        {
            config = SvnDeployConfigurationSection.GetConfiguration();
        }

        [Test]
        public void Applications_ReturnsCollection()
        {
            Assert.IsNotNull(config.Applications);
            Assert.AreEqual(2, config.Applications.Count);
            Assert.AreEqual("http://mysvnsource/first/trunk/deploy/prod", config.Applications[0].SvnPath);
            Assert.AreEqual(@"C:\inetpub\wwwroot\my_second_application", config.Applications[1].VirtualDirectory);
        }

        [Test]
        public void Authentication_ReturnsConfigurationValue()
        {
            Assert.AreEqual("domain", config.Authentication.Domain);
            Assert.AreEqual("user", config.Authentication.Username);
            Assert.AreEqual("pass", config.Authentication.Password);
        }

        [Test]
        public void Interval_ReturnsConfigurationValue()
        {
            Assert.AreEqual(60, config.Interval);
        }

        
    }
}
